package com.patternsbox.behavioral.visitor;

import com.patternsbox.ActionTemplate;

public class VisitorAction extends ActionTemplate {

	public void doAction() {
	      // Setup structure
	      ObjectStructure o = new ObjectStructure();
	      o.attach(new ConcreteElementA());
	      o.attach(new ConcreteElementB());
	      // Create visitor objects
	      Visitor v1 = new ConcreteVisitor1();
	      Visitor v2 = new ConcreteVisitor2();
	      // Structure accepting visitors
	      o.accept(v1);
	      o.accept(v2);
	}
}
